package com.ants.weixin.web.common;

import com.ants.platform.core.bean.Page;
import com.ants.platform.core.utils.ResponseUtil;
import com.ants.platform.weixin.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by liushun on 2016/8/17.
 */

@RestController
public class UserAjax {

    @Autowired
    private TestService testService;

    @RequestMapping(value = "/user/list", method = RequestMethod.GET)
    public Object getUsers(@RequestParam Integer pageNum
            , @RequestParam Integer pageSize
            , String orderField
            , String orderDirection) {
        long startTime = System.currentTimeMillis();
        Page page = testService.getList(pageNum, pageSize, orderField, orderDirection);
        return ResponseUtil.jsonSuccess(page, startTime);
    }
}
